Fix FTBFS with gcc-15
authorBoyuan Yang <byang@debian.org>
Tue, 9 Sep 2025 12:21:38 +0000 (08:21 -0400)
committerBoyuan Yang <byang@debian.org>
Tue, 9 Sep 2025 12:21:38 +0000 (08:21 -0400)
debian/changelog
debian/patches/backport/0006-Fix-build-for-gcc-15-934.patch [new file with mode: 0644]
debian/patches/backport/0007-Fix-deprecated-declarations-in-C-17.patch [new file with mode: 0644]
debian/patches/series

index e3402109dc79be52a5e0386aeb3234f1e9dabde6..18981b51a84d8cf5eb2d6c8c2ab88e2ea1142b82 100644 (file)
@@ -1,3 +1,11 @@
+opencc (1.1.9+ds1-2) unstable; urgency=medium
+
+  * debian/patches/backport/0006-Fix-build-for-gcc-15-934.patch,
+    debian/patches/backport/0007-Fix-deprecated-declarations-in-C-17.patch:
+    Backport upstream patches to fix FTBFS with GCC 15. (Closes: #1097512)
+
+ -- Boyuan Yang <byang@debian.org>  Tue, 09 Sep 2025 08:20:41 -0400
+
 opencc (1.1.9+ds1-1) unstable; urgency=medium
 
   * Upload to unstable.
diff --git a/debian/patches/backport/0006-Fix-build-for-gcc-15-934.patch b/debian/patches/backport/0006-Fix-build-for-gcc-15-934.patch
new file mode 100644 (file)
index 0000000..e53d301
--- /dev/null
@@ -0,0 +1,23 @@
+From: Peng Wu <alexepico@gmail.com>
+Date: Thu, 13 Feb 2025 00:15:10 +0800
+Subject: Fix build for gcc 15 (#934)
+
+Co-authored-by: Peng Wu <pwu@redhat.com>
+Bug-Debian: https://bugs.debian.org/1097512
+---
+ src/SerializedValues.hpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/SerializedValues.hpp b/src/SerializedValues.hpp
+index c17210b..f7e5bb2 100644
+--- a/src/SerializedValues.hpp
++++ b/src/SerializedValues.hpp
+@@ -18,6 +18,8 @@
+ #pragma once
++#include <cstdint>
++
+ #include "Common.hpp"
+ #include "SerializableDict.hpp"
diff --git a/debian/patches/backport/0007-Fix-deprecated-declarations-in-C-17.patch b/debian/patches/backport/0007-Fix-deprecated-declarations-in-C-17.patch
new file mode 100644 (file)
index 0000000..73f1f57
--- /dev/null
@@ -0,0 +1,33 @@
+From: WhiredPlanck <whiredplanck@outlook.com>
+Date: Sat, 5 Jul 2025 03:57:30 +0800
+Subject: Fix deprecated declarations in C++17
+
+---
+ src/Segments.hpp | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/Segments.hpp b/src/Segments.hpp
+index 2186dfd..57320fe 100644
+--- a/src/Segments.hpp
++++ b/src/Segments.hpp
+@@ -18,6 +18,7 @@
+ #pragma once
++#include <iterator>
+ #include <sstream>
+ #include "Common.hpp"
+@@ -53,8 +54,11 @@ public:
+     managed.push_back(str);
+   }
+-  class iterator : public std::iterator<std::input_iterator_tag, const char*> {
++  class iterator {
+   public:
++    using iterator_category = std::input_iterator_tag;
++    using value_type = const char*;
++
+     iterator(const Segments* const _segments, size_t _cursor)
+         : segments(_segments), cursor(_cursor) {}
index a577d9a999a7e5f542d3457474b2a8fe09dc876a..eb0994ee1064ed08d57c4baab21d75f78e47b3dd 100644 (file)
@@ -2,3 +2,5 @@
 0003-no-remote-images-when-reading-docs-on-disk.patch
 0004-Use-system-googletest.patch
 0005-Disable-build-in-setup.py.patch
+backport/0006-Fix-build-for-gcc-15-934.patch
+backport/0007-Fix-deprecated-declarations-in-C-17.patch